
package com.dhcc.bpm.modules.orga.service;

import com.dhcc.bpm.modules.common.vo.SelectVo;
import com.dhcc.bpm.modules.log.vo.AppApiViewVo;
import com.dhcc.bpm.modules.log.vo.AppRankVo;
import com.dhcc.bpm.modules.orga.entity.App;
import com.dhcc.bpm.modules.orga.entity.AppApi;
import com.dhcc.bpm.modules.orga.vo.AppTestNewVo;
import com.dhcc.bpm.modules.orga.vo.AppTestVo;
import com.dhcc.bpm.modules.orga.vo.AppVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;

/**
 * @ClassName IAppService
 * @Description 应用/渠道信息 服务类
 * @Author daina
 * @Date 2020/2/24 19:25
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
public interface IAppService extends BaseService<App> {

	/**
	 * @Description 自定义分页
	 * @Author daina
	 * @Date 10:15 2020/2/25
	 * @param page
	 * @param app
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.orga.vo.AppVO>
	 **/
	IPage<AppVO> selectAppPage(IPage<AppVO> page, AppVO app);
	/**
	 * @Description 根据产品id查询订阅该产品的渠道
	 * @Author daina
	 * @Date 14:21 2020/4/10
	 * @param opcProductId
	 * @return java.util.List<com.dhcc.bpm.modules.orga.entity.App>
	 **/
	List<App> listByProductId(Long opcProductId);
	IPage<AppVO> listApp(IPage<AppVO> page, AppVO app);

	/**
	 * @Description 自定义分页
	 * @Author daina
	 * @Date 10:15 2020/2/25
	 * @param page
	 * @param app
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.orga.vo.AppVO>
	 **/
	IPage<AppVO> selectAppFlow(IPage<AppVO> page, AppVO app);

	/**
	 * @Description 查询渠道列表
	 * @Author daina
	 * @Date 10:15 2020/2/25
	 * @param page
	 * @param app
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.orga.vo.AppVO>
	 **/
   IPage<AppVO> selectControllerAppListPage(IPage<AppVO> page, AppVO app);
	/**
	 * @Description 查询
	 * @Author daina
	 * @Date 10:15 2020/2/25
	 * @param appId
	 * @return com.dhcc.bpm.modules.orga.entity.App
	 **/
	App selectByAppCode(String appId);

	/**
	 * @Description 查询未分配的渠道列表
	 * @Author daina
	 * @Date 10:15 2020/2/25
	 * @param page
	 * @param app
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.orga.vo.AppVO>
	 **/
    IPage<AppVO> selectUnControllerAppList(IPage<AppVO> page, AppVO app);

	/**
	 * @Description 查询未分配的网关渠道列表
	 * @Author daina
	 * @Date 10:15 2020/2/25
	 * @param page
	 * @param app
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.orga.vo.AppVO>
	 **/
	IPage<AppVO> UnControllerOrgaGateList(IPage<AppVO> page, AppVO app);
	/**
	 * @Description 更新
	 * @Author daina
	 * @Date 10:14 2020/2/25
	 * @param opc_app_id
	 * @param valid_status
	 * @return int
	 **/
	int updateOpc_app_api(Long opc_app_id,String valid_status);
	/**
	 * @Description 更新
	 * @Author daina
	 * @Date 10:14 2020/2/25
	 * @param appApi
	 * @return int
	 **/
	int updateSingleOpc_app_api(AppApi appApi);

	/**
	 * @Description 查询应用关联API列表
	 * @Author daina
	 * @Date 10:14 2020/2/25
	 * @param opcAppId
	 * @return java.util.List<com.dhcc.bpm.modules.orga.entity.AppApi>
	 **/
	List<AppApi> listRelatedApi(Long opcAppId);
	/**
	 * @Description 查询
	 * @Author daina
	 * @Date 10:14 2020/2/25
	 * @param appCode
	 * @return com.dhcc.bpm.modules.orga.entity.App
	 **/
	App selectAppByAppCode(String appCode);
	/**
	 * @Description 更新
	 * @Author daina
	 * @Date 10:14 2020/2/25
	 * @param app
	 * @return int
	 **/
    int updateRefreshStatus(App app);

	/**
	 * @Description 审批通过后自动生成应用公私钥及秘钥信息
	 * @Author daina
	 * @Date 10:14 2020/2/25
	 * @param app
	 * @return boolean
	 **/
    boolean approvalCreateAppInfo(App app);
	/**
	 * @Description 审批通过后自动生成应用公私钥及秘钥信息
	 * @Author daina
	 * @Date 10:14 2020/2/25
	 * @param app
	 * @return boolean
	 **/
    boolean approvalCreateAppInfoProcess(App app);

	/**
	 * @Description 查询应用集合列表
	 * @Author daina
	 * @Date 10:15 2020/2/25
	 * @param page
	 * @param appApiViewVo
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
	IPage<AppApiViewVo> selectAppList(IPage<AppApiViewVo> page, AppApiViewVo appApiViewVo);

	/**
	 * @Description 统计应用条数
	 * @Author daina
	 * @Date 10:15 2020/2/25
	 * @param
	 * @return int
	 **/
	int countApp();

	/**
	 * @Description 应用变更信息
	 * @Author sjm
	 * @Date 14:09 2020/2/25 0025
	 * @param page
	 * @param app
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.orga.vo.AppVO>
	 **/
    IPage<AppVO> changeList(IPage<AppVO> page, AppVO app);

    /**
     * @Description 申请测试信息
     * @Author sjm
     * @Date 18:46 2020/2/26 0026
     * @param id
     * @return com.dhcc.bpm.modules.orga.vo.AppTestVo
     **/
    AppTestVo selectAppInfo(Long id);

    /**
     * @Description 查询变更后申请测试信息
     * @Author sjm
     * @Date 9:30 2020/2/27 0027
     * @param id
     * @return com.dhcc.bpm.modules.orga.vo.AppTestNewVo
     **/
    AppTestNewVo selectAppInfoNew(Long id);

    /**
     * @Description 查询渠道变更未审批数量
     * @Author xiafayu
     * @Date 2020/4/10 16:35
     * @param parentId
     * @return int
     * @throws
     **/
    int changeNum(Long parentId);

    /**
     * @Description 渠道号查询
     * @Author xiafayu
     * @Date 2020/4/23 18:07
     * @param appId
     * @return java.util.List<com.dhcc.bpm.modules.orga.vo.AppVO>
     * @throws
     **/
    List<AppVO>  findByAppId(String appId);

    List<AppVO>  findByAppIds(AppVO appVO);
	List<AppVO>  getAppList(AppVO appVO);
	List<AppVO>  getAppListByBasePro(AppVO appVO);
	List<AppVO>  getAppListBySysId(AppVO appVO);

	/**
	 * @Description 查询
	 * @Author daina
	 * @Date 15:49 2020/2/25
	 * @param
	 * @return java.util.List<com.dhcc.bpm.modules.common.vo.SelectVo>
	 **/
	List<SelectVo> selectByAppName();

	boolean delAppIdAndPid(List<Long> ids);

	List<App> findByPId(String pid);

	List<App> getListByExpire(String expire);

	List<SelectVo> selectAppName();

	IPage<AppRankVo> countAppNum(IPage<AppRankVo> page, AppRankVo appRank);
}
